package net.oschina.allchat.message.processing.json.parsers.convention;

import net.oschina.allchat.message.processing.IParser;
import net.oschina.allchat.message.processing.IParserFactory;
import net.oschina.allchat.protocol.core.Protocol;

public class NamingConventionParserFactory<T> implements IParserFactory<T> {
	private Protocol protocol;
	private NamingConventionParser<T> parser;
	
	public NamingConventionParserFactory(Protocol protocol, Class<T> objectType) {
		this.protocol = protocol;
		parser = new NamingConventionParser<T>(objectType);
	}

	@Override
	public Protocol getProtocol() {
		return protocol;
	}

	@Override
	public IParser<T> create() {
		return parser;
	}
}
